a11y: Remove idle handler for expander actions
authorBenjamin Otte <otte@redhat.com>
Tue, 28 Jun 2011 18:03:35 +0000 (20:03 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 5 Jul 2011 20:08:55 +0000 (16:08 -0400)
gtk/a11y/gailexpander.c
gtk/a11y/gailexpander.h

index e9d7c0bb0f2ad26af45f8663888dee3ed6bf9c04..d8234ba60d5018845060a2c628e6b84323083828 100644 (file)
@@ -49,7 +49,6 @@ static const gchar* gail_expander_get_full_text    (GtkExpander       *widget);
 static void                  atk_action_interface_init  (AtkActionIface *iface);
 static gboolean              gail_expander_do_action    (AtkAction      *action,
                                                          gint           i);
-static gboolean              idle_do_action             (gpointer       data);
 static gint                  gail_expander_get_n_actions(AtkAction      *action);
 static const gchar* gail_expander_get_keybinding
                                                         (AtkAction      *action,
@@ -85,7 +84,6 @@ static void
 gail_expander_init (GailExpander *expander)
 {
   expander->activate_keybinding = NULL;
-  expander->action_idle_handler = 0;
   expander->textutil = NULL;
 }
 
@@ -305,7 +303,6 @@ gail_expander_do_action (AtkAction *action,
                          gint      i)
 {
   GtkWidget *widget;
-  GailExpander *expander;
   gboolean return_value = TRUE;
 
   widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
@@ -318,14 +315,10 @@ gail_expander_do_action (AtkAction *action,
   if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
     return FALSE;
 
-  expander = GAIL_EXPANDER (action);
   switch (i)
     {
     case 0:
-      if (expander->action_idle_handler)
-        return_value = FALSE;
-      else
-       expander->action_idle_handler = gdk_threads_add_idle (idle_do_action, expander);
+      gtk_widget_activate (widget);
       break;
     default:
       return_value = FALSE;
@@ -334,25 +327,6 @@ gail_expander_do_action (AtkAction *action,
   return return_value; 
 }
 
-static gboolean
-idle_do_action (gpointer data)
-{
-  GtkWidget *widget;
-  GailExpander *gail_expander;
-
-  gail_expander = GAIL_EXPANDER (data);
-  gail_expander->action_idle_handler = 0;
-
-  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (gail_expander));
-  if (widget == NULL /* State is defunct */ ||
-      !gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
-    return FALSE;
-
-  gtk_widget_activate (widget);
-
-  return FALSE;
-}
-
 static gint
 gail_expander_get_n_actions (AtkAction *action)
 {
@@ -454,11 +428,6 @@ gail_expander_finalize (GObject *object)
   GailExpander *expander = GAIL_EXPANDER (object);
 
   g_free (expander->activate_keybinding);
-  if (expander->action_idle_handler)
-    {
-      g_source_remove (expander->action_idle_handler);
-      expander->action_idle_handler = 0;
-    }
   if (expander->textutil)
     g_object_unref (expander->textutil);
 
index 37969b49b6649668047cfbf1bc1b37ef3427e8c3..9883b3ddfcb4a638043e0353b7d669521669e00b 100644 (file)
@@ -40,7 +40,6 @@ struct _GailExpander
   GailContainer parent;
 
   gchar         *activate_keybinding;
-  guint         action_idle_handler;
 
   GailTextUtil   *textutil;
 };